/**
 * Created with IntelliJ IDEA.
 * Description:
 * Date: 2023-05-13
 * Time: 23:34
 */
/*class A{

}
class B extends  A{

}
class C extends B{

}
public class Test {
    public static void main(String[] args) {
        A a0 = new A();
        A a1 = new B();
        A a2 = new C();
    }
}*/

abstract class Shape{
    public abstract void draw();
}
//alt + 回车
class Rect extends Shape{
    @Override
    public void draw() {
        System.out.println("画矩形！");
    }
}
class Cycle extends Shape{
    @Override
    public void draw() {
        System.out.println("画圆！");
    }
}
class Flower extends Shape{
    @Override
    public void draw() {
        System.out.println("画花！");
    }
}
public class Test {
    public static void drawMap(Shape shape){
        shape.draw();
    }
    public static void main(String[] args) {
        Cycle cycle = new Cycle();
        Flower flower = new Flower();

        drawMap(cycle);
        drawMap(flower);
        System.out.println("========================");
        Shape[] shapes = {cycle,flower};
        for(Shape shape : shapes){
            shape.draw();
        }
    }
}
